import React from 'react';
import {
	Routes,
	Route, Navigate, NavLink
} from "react-router-dom";
import Home from "./pages/Home";
import NewsList from "./pages/NewsList";
import GoodsList from "./pages/GoodsList";
import My from "./pages/My";
import NotFound from "./pages/NotFound";
import "./App.css";
import MyNav from "./components/MyNav";
import MyNews from "./pages/MyNews";
import MyCollect from "./pages/MyCollect";

function App(props) {
	return (
		<div className={"container"}>
			<MyNav/>
			<Routes>
				<Route path={"*"} element={<NotFound/>}></Route>
				<Route path={"/"} element={<Home/>}></Route>
				<Route path={"/goodsList/:a/:b"} element={<GoodsList/>}></Route>
				<Route path={"/newsList/:a/:b.html"} element={<NewsList/>}></Route>
				<Route path={"/my"} element={<My/>}>
					{/*<Route index element={<Navigate to={"/my/news"}/>}></Route>*/}
					<Route path={"/my"} element={<MyNews/>}></Route>
					<Route path={"/my/collect"} element={<MyCollect/>}></Route>
				</Route>
				<Route path={"/home"} element={<Navigate to={"/"}/>}></Route>
			</Routes>
		</div>
	);
}

export default App;